﻿using DataModels.Enums.Home;
using SqlSugar;

namespace DataModels.Entities.HomeService
{
    /// <summary>
    /// 拼团组表
    /// </summary>
    [SugarTable]
    public class HomeServiceProductGroupParticipant
    {
        [SugarColumn(IsPrimaryKey = true)]
        public Guid UUID { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 拼团活动UUID
        /// </summary>
        public Guid HomeServiceProductGroupActivityUUID { get; set; }

        /// <summary>
        /// 参团人员UUID
        /// </summary>
        public Guid UserUUID { get; set; }

        /// <summary>
        /// 订单UUID
        /// </summary>
        public Guid HomeServiceOrderUUID { get; set; }

        /// <summary>
        /// 拼团商品UUID  -   一个商品同一个日期为一个拼团组
        /// </summary>
        public Guid HomeServiceProductUUID { get; set; }

        /// <summary>
        /// 团日期   -   一个商品同一个日期为一个拼团组
        /// </summary>
        public DateTime GroupDate { get; set; }

        /// <summary>
        /// 团过期时间 - 定时任务会定时清理过期的拼团
        /// </summary>
        public DateTime? ExpireTime { get; set; }

        /// <summary>
        /// 拼团状态
        /// </summary>
        public GroupParticipantStatus Status { get; set; } = GroupParticipantStatus.PendingPayment;

        public DateTime CreateTime { get; set; } = DateTime.Now;
        public Guid CreateUserUUID { get; set; }
        public DateTime UpdateTime { get; set; } = DateTime.Now;
        public Guid UpdateUserUUID { get; set; }
    }
}
